package com.jiyang.jyandroid.other;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

import com.jiyang.jyandroid.test06.Six_1Activity;

/**
 * Created by jy on 2016/11/25.
 * 我的广播接收器
 */

public class MyBroadCast extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals(Six_1Activity.MY_BROADCAST)) {
            Toast.makeText(context, intent.getStringExtra("msg"), Toast.LENGTH_SHORT).show();
            Intent intent1 = new Intent(context, ServiceTest.class);
            context.startService(intent1);
        }
    }
}
